package com.java.comprehensive.design.behavioral_model.memento_pattern.while_box;

public class Client {
    public static void main(String[] args) {
        System.out.println("-------------------boos start--------------------");
        GameRole gameRole = new GameRole();
        gameRole.initState();
        gameRole.stateDisplay();

        //存储备忘录对象
        RoleStateCaretaker roleStateCaretaker = new RoleStateCaretaker();
        roleStateCaretaker.setRoleStateMemento(gameRole.saveState());
        gameRole.fight();

        System.out.println("-------------------boos end--------------------");
        gameRole.stateDisplay();
        gameRole.recoverState(roleStateCaretaker.getRoleStateMemento());

        System.out.println("--------------------状态回复------------------------");
        gameRole.stateDisplay();
    }
}
